package com.myproject.entity;

import java.util.HashSet;

public class Teacher {

    private String name;
    private String home;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHome() {
        return home;
    }

    public void setHome(String home) {
        this.home = home;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", home='" + home + '\'' +
                '}';
    }

    public static void main(String[] args) {
        Teacher teacher = new Teacher();
        teacher.setName("tom");

        Teacher teacher1 = new Teacher();
        teacher1.setName("tom");

        HashSet set = new HashSet<Teacher>();
        set.add(teacher);
        set.add(teacher1);
        System.out.println(set.size());
    }
}
